<%@page import="com.winexpress.util.SessionAttributes"%>
<%@taglib prefix="t" tagdir="/WEB-INF/tags" %>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>wineXpress online shop</title>
    </head>
    <body>
        <t:customerNavigation/>
        <br/>
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header">Customer Particular</h1>
                    <ol class="breadcrumb">
                        <li><a href="/WineXpressClient/index.jsp">Home</a></li>
                        <li><class="active">Customer Particular</li>
                    </ol>
                </div>
            </div>
            <div class="panel panel-default" style="width:80%; margin-left: 15%; margin-top: 10px" >
                <div class="panel-heading">
                    <h3 class="panel-title">Edit Customer Paticular</h3>
                </div>
                <div class="panel-body">
                    <form class="form-horizontal" role="form" id="defaultForm"  name="register" action="/WineXpressClient/accountManagement/customerParticularResult" method="post">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">Email</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="email" value="<%= session.getAttribute(SessionAttributes.USER_EMAIL)%>">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">First Name</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="firstName" value="<%= session.getAttribute(SessionAttributes.USER_FIRST_NAME)%>" >
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">Last Name</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="lastName" value="<%= session.getAttribute(SessionAttributes.USER_LAST_NAME)%>">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">Age</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="age" value="<%= session.getAttribute(SessionAttributes.USER_AGE)%>">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">Phone Number</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="phoneNumber" value="<%= session.getAttribute(SessionAttributes.USER_PHONE_NUMBER)%>" >
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">Credit Card Number</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="creditCardNumber" value="<%= session.getAttribute(SessionAttributes.CUSTOMER_CREDIT_CARD_NUMBER)%>">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">Shipping Address</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="address" value="<%= session.getAttribute(SessionAttributes.CUSTOMER_ADDRESS)%>">
                            </div>
                        </div>
                        <input type="hidden" class="form-control" name="particularForm" value="particularForm">
                        <div class="form-group">
                            <div class="col-sm-offset-10 col-sm-2">
                                <button class="btn btn-default" type="submit" class="btn btn-default">Save</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            <script type="text/javascript">
                $(document).ready(function() {
                    $('#defaultForm').bootstrapValidator({
                        message: 'This value is not valid',
                        fields: {
                            email: {
                                validators: {
                                    notEmpty: {
                                        message: 'The email address is required and can\'t be empty'
                                    },
                                    emailAddress: {
                                        message: 'The input is not a valid email address'
                                    }
                                }
                            },
                            phoneNumber: {
                                validators: {
                                    digits: {
                                        message: 'The value can contain only digits'
                                    }
                                }
                            },
                            firstName: {
                                message: 'The username is not valid',
                                validators: {
                                    notEmpty: {
                                        message: 'The username is required and can\'t be empty'
                                    },
                                    stringLength: {
                                        min: 2,
                                        max: 30,
                                        message: 'The username must be more than 2 and less than 30 characters long'
                                    },
                                    regexp: {
                                        regexp: /^[a-zA-Z0-9_\.]+$/,
                                        message: 'The username can only consist of alphabetical, number, dot and underscore'
                                    }
                                }
                            },
                            lastName: {
                                message: 'The username is not valid',
                                validators: {
                                    notEmpty: {
                                        message: 'The username is required and can\'t be empty'
                                    },
                                    stringLength: {
                                        min: 2,
                                        max: 30,
                                        message: 'The username must be more than 2 and less than 30 characters long'
                                    },
                                    regexp: {
                                        regexp: /^[a-zA-Z0-9_\.]+$/,
                                        message: 'The username can only consist of alphabetical, number, dot and underscore'
                                    }
                                }
                            },
                            age: {
                                validators: {
                                    notEmpty: {
                                        message: 'The age is required and can\'t be empty'
                                    },
                                    lessThan: {
                                        value: 100,
                                        inclusive: true,
                                        message: 'The ages has to be less than 100'
                                    },
                                    greaterThan: {
                                        value: 10,
                                        inclusive: false,
                                        message: 'The ages has to be greater than or equals to 10'
                                    }
                                }
                            },
                            creditCardNumber: {
                                notEmpty: {
                                    message: 'The credit card number is required and can\'t be empty'
                                },
                                validators: {
                                    creditCard: {
                                        message: 'The input is not a valid credit card number'
                                    }
                                }
                            },
                            address: {
                                validators: {
                                    notEmpty: {
                                        message: 'The address is required and can\'t be empty'
                                    }
                                }
                            }
                        }
                    });
                });
            </script>
        </div>
        <t:footer/>
    </body>
</html>
